layui.use(["form", "ax"], function () {
    var form = layui.form;
    var $ax = layui.ax;

    // 表单提交事件
    form.on('submit(btnSubmit)', function (data) {
        var ajax = new $ax(Feng.ctxPath + "/ecGroup/setGroupVoiceWhite", function (data) {
            layer.open({
                content: "设置成功！",
                skin: 'layui-layer-molv',
                yes: function (index, layero) {
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                    parent.layui.table.reload("groupVoiceWhiteTable");
                }
            });
        }, function (data) {
            layer.open({
                content: "操作失败," + data.responseJSON.message,
                skin: 'layui-layer-molv',
                yes: function (index, layero) {
                    layer.close(index);
                }
            });
        });
        ajax.set(data.field);
        ajax.start();

        //添加 return false 可成功跳转页面
        return false;
    });
});